package com.huike.report.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.huike.business.domain.vo.BusinessTrackVo;
import com.huike.report.domain.vo.BusinessChangeVo;
import com.huike.report.domain.vo.DateClueVo;
import com.huike.report.domain.vo.SubjectPieChartVo;
import org.apache.ibatis.annotations.Param;

import com.huike.clues.domain.vo.IndexStatisticsVo;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 首页统计分析的Mapper
 * @author Administrator
 *
 */
public interface ReportMapper {
	/**=========================================基本数据========================================*/
	/**
	 * 获取线索数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getCluesNum(@Param("startTime") String beginCreateTime,
						@Param("endTime") String endCreateTime,
						@Param("username") String username);

	/**
	 * 获取商机数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getBusinessNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getContractNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同金额
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Double getSalesAmount(@Param("startTime") String beginCreateTime,
						  @Param("endTime") String endCreateTime,
						  @Param("username") String username);


	/**=========================================今日简报========================================*/
	Integer getTodayCluesNum(@Param("username") String username,@Param("nowTime") String nowTime);

	Integer getTodayBusinessNum(@Param("username") String username,@Param("nowTime") String nowTime);

	Integer getTodayContractNum(@Param("username") String username,@Param("nowTime") String nowTime);

	Double getTodaySalesAmount(@Param("username") String username,@Param("nowTime") String nowTime);

	Integer getTofollowedCluesNum(@Param("username") String username,@Param("beginCreateTime") Date beginCreateTime,@Param("endCreateTime") Date endCreateTime);

	Integer getTofollowedBusinessNum(@Param("username") String username,@Param("beginCreateTime") Date beginCreateTime,@Param("endCreateTime") Date endCreateTime);

	Integer getToallocatedCluesNum(@Param("username") String username,@Param("beginCreateTime") Date beginCreateTime,@Param("endCreateTime") Date endCreateTime);

	Integer getToallocatedBusinessNum(@Param("username") String username,@Param("beginCreateTime") Date beginCreateTime,@Param("endCreateTime") Date endCreateTime);

	List<SubjectPieChartVo> subjectStatisticsList(@Param("begin") String begin,@Param("end") String end);


	List<DateClueVo> cluesStatistics(@Param("begin") String begin, @Param("end") String end) ;

	Integer getCluesNums(@Param("begin") String begin, @Param("end") String end);

	Integer getEffectiveCluesNums(@Param("begin") String begin, @Param("end") String end);

	Integer getBusinessNums(@Param("begin") String begin, @Param("end") String end);

	Integer getContractNums(@Param("begin") String begin, @Param("end") String end);

	List<BusinessChangeVo> getBusinessChangeStatistics(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

	List<BusinessChangeVo> getSalesStatistic(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);


	/**=========================================待办========================================*/

}
